import request from 'axios';

export function fetchArticle(dataId) {
  return request({
    url: `api/home/detail/${dataId}`,
    method: 'get',
    transformResponse: [function (data) {
      // dataId 如果是数字，会超出范围，后几位会被转为0失真，故转为字符串
      return data.replace(/\"id\":(\d+),/g,"\"id\":\"$1\",");
    }]
  })
}
